package main

import (
	"fmt"
)

func main() {
	var t, n, v, s int

	fmt.Scan(&t)
	for i := 0; i < t; i++ {

		s = 0
		fmt.Scan(&n)
		for j := 0; j < n; j++ {
			fmt.Scan(&v)
			s += v
		}
		fmt.Println(s)
	}
}